From: Wei Liu Date: Sun, 10 May 2015 13:14:51 +0000 (+0100) Subject: pvgrub: initialise p2m_size X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3266 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6b351c78a436530d136e1111bafe5e8e0d290492;p=xen.git pvgrub: initialise p2m_size In 84083790 ("libxc: add p2m_size to xc_dom_image") a new field is added. We should initialised this field in pvgrub as well, otherwise xc_dom_build_image won't work properly. Signed-off-by: Wei Liu Cc: Ian Campbell Cc: Ian Jackson Acked-by: Ian Campbell --- diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c index dc8db81044..4c33b25767 100644 --- a/stubdom/grub/kexec.c +++ b/stubdom/grub/kexec.c @@ -276,12 +276,13 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char dom->total_pages = start_info.nr_pages; /* equivalent of arch_setup_meminit */ + dom->p2m_size = dom->total_pages; /* setup initial p2m */ - dom->p2m_host = malloc(sizeof(*dom->p2m_host) * dom->total_pages); + dom->p2m_host = malloc(sizeof(*dom->p2m_host) * dom->p2m_size); /* Start with our current P2M */ - for (i = 0; i < dom->total_pages; i++) + for (i = 0; i < dom->p2m_size; i++) dom->p2m_host[i] = pfn_to_mfn(i); if ( (rc = xc_dom_build_image(dom)) != 0 ) {